3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
The 3D Viewer provides routines that you can use to update the file or memory copy of the 3D data displayed in a viewer.
You can use the Q3ViewerWriteFile function to update the file data being displayed in a viewer.
The Q3ViewerWriteFile function writes the 3D data currently associated with the viewer object specified by the theViewer parameter in 3DMF format to the file specified by the refnum parameter. If the kQ3ViewerOutputTextMode flag has been set, the 3DMF data is written out in text mode; otherwise, it is written out in binary mode.
If the camera viewpoint has been modified, a new camera is added to the 3D metafile data's view hints.
You can use the Q3ViewerWriteData function to update the memory data being displayed in a viewer.
TQ3Status Q3WinViewerWriteData (
TQ3ViewerObject viewer,
void *data,
unsigned long dataSize,
unsigned long *actualDataSize );
The Q3ViewerWriteData function allocates a block of memory large enough to hold a 3DMF description of the model currently displayed in the viewer object specified by the theViewer parameter, writes that description into the block of memory, and returns the address of that block of memory in the data parameter. The Mac OS version of Q3ViewerWriteData returns, as its function result, the size (in bytes) of that block of memory.
If the kQ3ViewerOutputTextMode flag has been set, the 3DMF data is written out in text mode; otherwise, it is written out in binary mode.
If the camera viewpoint has been modified, a new camera is added to the 3DMF data's view hints.
The block of memory that contains the 3D data is allocated by the 3D Viewer and must not be disposed of by your application. You should copy the 3D data into your own storage if you will need to access it after all viewer objects created by your application have been destroyed.
Previous | QD3D Book | Overview | Chapter Contents | Next |